package collection.stream;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class Test2 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("www.baidu.com");
        list.add("www.google.com");
        list.add("www.jd.com");
        list.add("www.qq.com");
        list.add("www.sina.com");
        list.add("www.taobao.com");
        list.add("www.163.com");
        list.add("www.yahoo.com");
        List<String>list1=list.stream()
                .map(e->e.substring(4,e.lastIndexOf(".")))
                .filter(e->e.length()>=3)
                .map(e->e.toUpperCase())
                .sorted((e1,e2)->e2.length()-e1.length())
                .collect(Collectors.toList());
        System.out.println(list1);
    }

}
